﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SalePartial.IDAL;
using SalePartial.Model;
using System.Data.SqlClient;
using System.Data;

namespace SalePartial.BLL
{
    public class XPFavoriteVedor : IXPFavoriteVedor
    {
        private IXPFavoriteVedor dal = SalePartial.DALFactory.DataAccess.CreateXPFavoriteVedor();

        public  XPFavoriteVedorInfo GetXPFavoriteVedor(int id)
        {
            SqlDataReader reader = this.SelectReader(id);
            XPFavoriteVedorInfo info = null;
            if (reader.Read())
            {
                info = new XPFavoriteVedorInfo(reader);
                if (!reader.IsClosed)
                {
                    reader.Close();
                }
            }

            return info;
        }

        public int Delete(int FavorID)
        {
            return dal.Delete(FavorID);
        }

        public int DeleteByCompanyID(Guid CompanyID)
        {
            return dal.DeleteByCompanyID(CompanyID);
        }

        public int DeleteByVendorID(Guid VendorID)
        {
            return dal.DeleteByVendorID(VendorID);
        }

        public int DeleteDynamic(string v_whereCondition)
        {
            return dal.DeleteDynamic(v_whereCondition);
        }

        public int Insert(XPFavoriteVedorInfo info)
        {
            return dal.Insert(info);
        }

        public DataSet SelectAll()
        {
            return dal.SelectAll();
        }

        public DataSet SelectByCompanyID(Guid CompanyID)
        {
            return dal.SelectByCompanyID(CompanyID);
        }

        public DataSet SelectByVendorID(Guid VendorID)
        {
            return dal.SelectByVendorID(VendorID);
        }

        public DataSet SelectDynamic(string v_whereCondition, string v_orderByExpression)
        {
            return dal.SelectDynamic(v_whereCondition, v_orderByExpression);
        }

        public DataSet SelectPaged()
        {
            return dal.SelectPaged();
        }

        public SqlDataReader SelectReader(int FavorID)
        {
            return dal.SelectReader(FavorID);
        }

        public SqlDataReader SelectReaderByCompanyID(Guid CompanyID)
        {
            return dal.SelectReaderByCompanyID(CompanyID);
        }

        public SqlDataReader SelectReaderByVendorID(Guid VendorID)
        {
            return dal.SelectReaderByVendorID(VendorID);
        }

        public DataSet SelectSingle(int FavorID)
        {
            return dal.SelectSingle(FavorID);
        }

        public int Update(XPFavoriteVedorInfo info)
        {
            return dal.Update(info);
        }

    }
}
